// GraphPanel.cpp : implementation file
//

#include "stdafx.h"
#include "MotionControlSoftware.h"
#include "GraphPane.h"


// CGraphPane

IMPLEMENT_DYNAMIC(CGraphPane, CDockablePane)

CGraphPane::CGraphPane()
{

}

CGraphPane::~CGraphPane()
{
}


BEGIN_MESSAGE_MAP(CGraphPane, CDockablePane)
	ON_WM_CREATE()
	ON_WM_DESTROY()
	ON_WM_SIZE()
	ON_WM_SHOWWINDOW()
	ON_WM_CONTEXTMENU()
END_MESSAGE_MAP()



// CGraphPane message handlers



int CGraphPane::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
		return -1;

	// TODO:  Add your specialized creation code here
	m_graphSetPage.Create(IDD_DLG_GRAPHSET,this);
	m_graphSetPage.ShowWindow(SW_SHOW);

	return 0;
}


void CGraphPane::OnDestroy()
{
	CDockablePane::OnDestroy();

	// TODO: Add your message handler code here
	m_graphSetPage.DestroyWindow();
}


void CGraphPane::OnSize(UINT nType, int cx, int cy)
{
	CDockablePane::OnSize(nType, cx, cy);

	// TODO: Add your message handler code here
	if (m_graphSetPage.GetSafeHwnd())
	{
		CRect rct;
		GetClientRect(rct);
		m_graphSetPage.MoveWindow(rct);
	}
}


void CGraphPane::OnShowWindow(BOOL bShow, UINT nStatus)
{
	CDockablePane::OnShowWindow(bShow, nStatus);

	// TODO: Add your message handler code here
	m_graphSetPage.UpdateDoc();
}

void CGraphPane::OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/)
{
	// TODO: Add your message handler code here
//	MessageBox(_T("a"));
}
